#pragma once

#include "tokSpliter.h"
#include <vector>
using namespace std;
#include "SKTLIB.H"
#include "deelx.h"
class DLNData
{
public:
	DLNData(const DLNData& rhs);
	DLNData(char* szDlnData);
	DLNData(const COleDateTime& rTime,float rValue)
	{
		time = rTime;
		value = rValue;
	}
	static bool IsDLNFmt( char* checked );
	const DLNData& operator = (const DLNData& rhs);
	CString GetDLNString();
public:
	COleDateTime time;
	float        value;
};
class DLNDayRecord
{
public:
	DLNDayRecord(int y,int m,int d,char* ID)
		:year(y)
		,month(m)
		,day(d)
	{
		ASSERT(strlen(ID)==8);
		ZeroMemory(id,9);
		strcpy(id,ID);
		for(int i= 0 ; i< 24;i++)
			hours[i] = NULL;
	}
	~DLNDayRecord()
	{
		for(int i= 0 ; i< 24;i++)
		if(hours[i])
			delete hours[i];
	}
	void Parse(char* outDayRecord);
	CString GetDayString();
	
public:
	DLNData* hours[24];
	char id[9];
	int year;
	int month;
	int day;
};
class DLNMonthRecord
{
public:
	DLNMonthRecord(char* ID,const CString& in,const CString& out);
	~DLNMonthRecord();
public:
	void LoadFromOut();
public:
    CString OUTPATH;
	int year;
	int month;
	int MaxDaySize;
	DLNDayRecord* *dayRecords;
	DLNDayRecord* nextMonthDay;
};
class DLN_GSM_Transform
{
public:
	DLN_GSM_Transform(HWND* ph,const CString& StationPath,char* downloaded);
	~DLN_GSM_Transform(void);
public:
	void Push(CString& fin);
	void SetPath(const CString& StationPath);
	bool LoadFile(char* filename);
	void dispath();
	CString GetInputFileName(DLNData& rhs);
	CString GetOutputFileName(const CString& fname);
public:
	vector<DLNData*>ddArray;
	vector<CString*>finArray;
	HWND* phwnd;
	CString INPATH;
	CString OUTPATH;
	CString StationName;
};
